//
//  QZSetPassWordVC.m
//  map
//
//  Created by 000 on 16/8/18.
//  Copyright © 2016年 faner. All rights reserved.
//

#import "QZSetPassWordVC.h"
//#import "MapVC.h"
#import <BmobSDK/Bmob.h>
#import <BmobSDK/BmobSMS.h>
//#import "ViewController.h"
@interface QZSetPassWordVC ()

- (IBAction)commitBtnClick:(id)sender;
@end

@implementation QZSetPassWordVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

- (IBAction)commitBtnClick:(id)sender {
    NSString *passwordStr = self.passWordTextField.text;
    NSString *message = nil;
    if ([passwordStr length]==0) {
        message = @"请输入密码";
    }
    else if ([passwordStr length]<6)
    {
        message = @"密码不能小于6位";
    }
    else
    {
        BmobUser *bUser = [[BmobUser alloc]init];
        [bUser setUsername:self.numPhone];
        [bUser setPassword:passwordStr];
        
//        [bUser setObject:self.numPhone forKey:@"userPhone"];
        [bUser signUpInBackgroundWithBlock:^(BOOL isSuccessful, NSError *error) {
            if (isSuccessful) {
//                MapVC *mapVC = [[MapVC alloc] init];
//                [self presentViewController:mapVC animated:YES completion:nil];
            } else {
//                NSLog(@"%@",error);
            }
        }];
        
    }
}
@end
